package com.xing.demo;

import java.util.Scanner;

public class 嵌套if选择 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入您的性别：");
        char gender = input.next().charAt(0);

        if(gender=='女') {
            System.out.println("请输入年龄：");
            int age = input.nextInt();
            if(age>18){
                System.out.println("女士你好");
            }else {
                System.out.println("小姐姐你好");
            }
        }else {
            System.out.println("帅哥你好");
        }

    }
}
